

import { Button, Modal } from "antd"
import { useState } from "react"

import { iconMap } from "@/components/Icon"

const content = '这是公告，建议盒子设置字体颜色，天气、时间、等设置inherit继承'
function Notice1({ title }) {

  const [isOpen, setIsOpen] = useState(false)

  return (
    <>
      <Button className="notice1-box" type="text" icon={iconMap['SoundOutlined']} onClick={() => setIsOpen(true)}>{title}</Button>
      <Modal
        title={title}
        className="notice1-modal"
        open={isOpen}
        footer={null}
        onCancel={() => setIsOpen(false)}>
        <div dangerouslySetInnerHTML={{ __html: content }}></div>
      </Modal>

    </>
  )
}

export default Notice1